qinglan.Canvas.movieClip = qinglan.Canvas.SpriteInterface.extend(function(qinglanImg, opt) {
	
	this.qinglanImg = qinglanImg || null;

	this._count = 0;
	this._duration = opt.durationFrames || qinglan.Canvas.Config.frames;
	this._frame = opt.frame || 1;
	this._cut = Math.floor(this._duration / this._frame);
	this._splitRepeat = opt.sRepeat == false ? false : true;
	this.warp = opt.warp || (new qinglan.Canvas.Vector2(0,0));

	this._lastMod = 0;
	this._startOffset = this.qinglanImg.offset.copy(); 
	this.init();
}).methods({
	init: function() {

	},
	change: function(){
		this._count++;
		var mod = Math.floor(this._count / this._cut);
	    if(mod == this._lastMod){return false;} // no change!
		this._lastMod = mod;
	    if(this._splitRepeat) {
	    	mod > (this._frame-1) && (this._count = 0) && (mod = 0);
	    }else{
	   		if(mod > this._frame){ return false;}
	   	}
	    this.qinglanImg.offset = this._startOffset.add(this.warp.multiply(mod));
	    // fix 
	    this.qinglanImg.offset.x >= this.qinglanImg.imgWidth && (this.qinglanImg.offset.x = this.qinglanImg.imgWidth - this.warp.x);
	    this.qinglanImg.offset.y >= this.qinglanImg.imgHeight && (this.qinglanImg.offset.y = this.qinglanImg.imgHeight - this.warp.y);
	},
	update: function(ctx) {
		this.qinglanImg.update(ctx);
		this.change(ctx);
	},
	draw: function(ctx) {
		//this.qinglanImg.draw(ctx);
		qinglan.Canvas.CanvasRender.drawSprite(ctx,this.qinglanImg);
	},
	destory: function(){

	},
	end: function(){
		
	}
});
